package nju.mscs.data.object;

import java.io.Serializable;
import java.util.ArrayList;

public class GiftList implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 2805041005564423475L;
	protected	ArrayList<Gift> giftList = new ArrayList<Gift>();
	
	protected Gift search(String id){
		for(Gift g:giftList)
			if(g.getId().equals(id))
				return g;
		return null;
	}
	protected boolean add(String name,String id){
		return giftList.add(new Gift(name,id));
	}
	
	protected boolean delete(String id){
		return giftList.remove(search(id));
	}
}
